Programming Questions for Practice
Write a program to test whether given year is leap year or not.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int year;
printf("Enter the year: ");
scanf("%d", &year);
if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
printf("%d is leap year\n", year);
}
else
printf("%d is not a leap year", year);
return 0;
}
Code not available...
Code not available...